<?php
/*************************************************************************
Class Pick_Dao_News
----------------------------------------------------------------
PICKCO CMS Project
Company: PICKCO  Co., Ltd  
Email: admin@pick.vn
Last updated: 15/07/2008
**************************************************************************/
class Pick_Dao_News extends Pick_Core_Objects {

	function Pick_Dao_News($database = '') {
		if(!$database) {
			global $db;
			$this->_db = $db;
		} else $this->_db = $database;
		$this->objectInfo 	= 'Pick_Dao_NewsInfo';
		$this->typeId = " AND typeid = 1";		
		$this->table = DB_PREFIX."product";
	}		
/*-----------------------------------------------------------------------*
* Function: cleanTrash
* Parameter: WHERE condition
* Return: true or false
*-----------------------------------------------------------------------*/
	function cleanTrash($condition = '1=1'){
		$dem = 0;
		$objectDelete = $this->getObjects(1, $condition, '', '');
		$productcategorysub = new Pick_Dao_ProductCategorySub();
		if($objectDelete){
			foreach($objectDelete['data'] as $object){
				$productcategorysub->cleanTrash("productid=".$object->getField('id'));
				$this->delete("id = " . $object->getField('id'));
			}
		}
		return true;
	}	
}
?>